{% include "../public/min-header.html" %}
<div class="wrapper">
	{% include "../public/breadcrumb.html" %}
    <section class="content ">
        <!-- Main content -->
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回管理员列表"><i class="fa fa-reply"></i></a>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i>{{'添加' if act=='add' else '修改'}}管理员</h3>
                </div>
                <div class="panel-body ">   
                    <!--表单数据-->
                    <form  id="submitForm">
                        <!--通用信息-->
                    <div class="tab-content col-md-10">                 	  
                        <div class="tab-pane active" id="tab_tongyong">                           
                            <table class="table table-bordered">
                                <tbody>
	                                <tr>
	                                    <td class="col-sm-2">用户名：</td>
	                                    {% if act == 'add'%}
		                                    <td class="col-sm-8">
		                                        <input type="text" class="form-control" name="user_name" placeholder="长度不能低于3位，且只能是字母数字以及_-">
		                                    </td>
	                                    {% else %}
	                                    	<td class="col-sm-8">{{info.user_name}} </td>
	                                    {% endif %}
	                                </tr>  
	                                <tr>
	                                    <td>Email地址：</td>
	                                    <td >
	                         				<input type="email" class="form-control" name="email" value="{{info.email}}" >
	                                                                     
	                                    </td>
	                                </tr>  
	                                <tr>
	                                    <td>登陆密码：</td>
	                                    <td>
	                               			<input type="password" class="form-control" name="password" placeholder="长度不能低于6位">
	                                    </td>
	                                </tr>
	                                {% if act =='add' or info.admin_id > 1%}
		                                <tr>
		                                    <td>所属角色：</td>
		                                    <td>
		                             			<select name="role_id">
			                               			{% for item in  role_list %}
			                         					<option value="{{item.role_id}}" {%if act != 'add'%} {{ 'selected' if item.role_id == info.role_id else ''}} {% endif%} >{{item.role_name}}</option>
			                         				{% endfor %}
		                         				</select>    
		                                    </td>
		                                </tr>
	                                {% endif%}
                                </tbody> 
                                <tfoot>
                                	<tr>
                                	<td>
                                		<input type="hidden" name="act" value="{{act}}">
                                		<input type="hidden" name="admin_id" value="{{info.admin_id}}">
                                	</td>
                                	<td class="text-left"><input class="btn btn-primary" type="button" data-post-url="{{helper.pathFor('adadif')}}" value="保存" id="submitBtn" data-jump-url="{{helper.pathFor('adadin')}}"></td></tr>
                                </tfoot>                               
                                </table>
                        </div>                           
                    </div>              
			    	</form><!--表单数据-->
                </div>
            </div>
        </div>
    </section>
</div>

{% include "../public/main-footer.html" %}